const { BrowserWindow } = require('electron')

const createWin = (options, loadFile) => {
    const view = new BrowserWindow({
        ...options,
        show: false, // 窗口隐藏
        titleBarStyle: 'hidden',  // 隐藏标题栏
    })
    view.loadFile(loadFile)
    // 窗口准备好后才展示
    view.once('ready-to-show', () => {
        view.show()
    })
    return view
}

module.exports = {
    createWin
}